function [err, model] = err_obj_func(x)
  
    try 
        [err, ~, ~, model] = obj_func(x) ;
    catch
        err = Inf ;
        model = NaN;
    end
end